<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<script>

    // var声明变量会越域
    // let声明有严格的作用域，只能声明一次
    {
        var a = 1
        let b = 2
        console.log(b)
    }
    console.log(a)

    // const 声明只读变量、即常量
</script>
</body>
</html>